package com.lzm.util;

import com.lzm.bean.Courier;
import com.lzm.bean.User;

import javax.servlet.http.HttpSession;

public class UserUtil {
    public static String getUserName(HttpSession session){
        return (String) session.getAttribute("adminUserName");
    }
    public static String getUserPhone(HttpSession session){
              return "15918768111";
    }

    public static String getLoginSms(HttpSession session, String userPhone){
              return (String) session.getAttribute(userPhone);
    }
    public static void setLoginSms(HttpSession session,String userPhone,String code){
          session.setAttribute(userPhone,code);
    }
    public static void setUpdateSms(HttpSession session,String userPhone,String code){
        session.setAttribute(userPhone+"_update",code);
    }
    public static String getUpdateSms(HttpSession session, String userPhone){
        return (String) session.getAttribute(userPhone+"_update");
    }

    public static void setWxUser(HttpSession session, User user){
          session.setAttribute("wxUser",user);
    }
    public static void setWxUser(HttpSession session, Courier courier){
        session.setAttribute("wxUser", courier);
    }
    public static Object getWxUser(HttpSession session){
        return session.getAttribute("wxUser");
    }
}
